#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int* findDisappearedNumbers(int* nums, int numsSize, int* returnSize) {
	for (int i = 0; i < numsSize; i++) {
		if (nums[abs(nums[i]) - 1] > 0)
			nums[abs(nums[i]) - 1] = -(nums[abs(nums[i]) - 1]);
	}
	int* ret = (int*)malloc(sizeof(int) * (numsSize));
	*returnSize = 0;
	for (int i = 0; i < numsSize; i++) {
		if (nums[i] > 0) {
			ret[*returnSize] = i + 1;
			*returnSize += 1;
		}
	}
	return ret;
}
int main() {
	int nums[] = { 4, 3, 2, 7, 8, 2, 3, 1 };
	int numsSize = 8;
	int returnSize = 0;
	int* result = findDisappearedNumbers(nums, numsSize, &returnSize);
	for (int i = 0; i < returnSize; i++) {
		printf("%d ", result[i]);
	}
	printf("\n");
	free(result);
	return 0;
}